import 'package:nyh_motorcade_app/entity/transaction_flow_entity.dart';

transactionFlowEntityFromJson(TransactionFlowEntity data, Map<String, dynamic> json) {
	if (json['orderCount'] != null) {
		data.orderCount = json['orderCount'] is String
				? int.tryParse(json['orderCount'])
				: json['orderCount'].toInt();
	}
	if (json['orderQuantity'] != null) {
		data.orderQuantity = json['orderQuantity'] is String
				? double.tryParse(json['orderQuantity'])
				: json['orderQuantity'].toDouble();
	}
	if (json['listedAmount'] != null) {
		data.listedAmount = json['listedAmount'] is String
				? double.tryParse(json['listedAmount'])
				: json['listedAmount'].toDouble();
	}
	if (json['orderAmount'] != null) {
		data.orderAmount = json['orderAmount'] is String
				? double.tryParse(json['orderAmount'])
				: json['orderAmount'].toDouble();
	}
	if (json['serveAmount'] != null) {
		data.serveAmount = json['serveAmount'] is String
				? double.tryParse(json['serveAmount'])
				: json['serveAmount'].toDouble();
	}
	if (json['reconciliationStatus'] != null) {
		data.reconciliationStatus = json['reconciliationStatus'];
	}
	if (json['pageVo'] != null) {
		data.pageVo = TransactionFlowPageVo().fromJson(json['pageVo']);
	}
	return data;
}

Map<String, dynamic> transactionFlowEntityToJson(TransactionFlowEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['orderCount'] = entity.orderCount;
	data['orderQuantity'] = entity.orderQuantity;
	data['listedAmount'] = entity.listedAmount;
	data['orderAmount'] = entity.orderAmount;
	data['serveAmount'] = entity.serveAmount;
	data['reconciliationStatus'] = entity.reconciliationStatus;
	data['pageVo'] = entity.pageVo?.toJson();
	return data;
}

transactionFlowPageVoFromJson(TransactionFlowPageVo data, Map<String, dynamic> json) {
	if (json['page'] != null) {
		data.page = json['page'] is String
				? int.tryParse(json['page'])
				: json['page'].toInt();
	}
	if (json['pageSize'] != null) {
		data.pageSize = json['pageSize'] is String
				? int.tryParse(json['pageSize'])
				: json['pageSize'].toInt();
	}
	if (json['total'] != null) {
		data.total = json['total'] is String
				? int.tryParse(json['total'])
				: json['total'].toInt();
	}
	if (json['totalPage'] != null) {
		data.totalPage = json['totalPage'] is String
				? int.tryParse(json['totalPage'])
				: json['totalPage'].toInt();
	}
	if (json['item'] != null) {
		data.item = (json['item'] as List).map((v) => TransactionFlowPageVoItem().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> transactionFlowPageVoToJson(TransactionFlowPageVo entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['page'] = entity.page;
	data['pageSize'] = entity.pageSize;
	data['total'] = entity.total;
	data['totalPage'] = entity.totalPage;
	data['item'] =  entity.item?.map((v) => v.toJson())?.toList();
	return data;
}

transactionFlowPageVoItemFromJson(TransactionFlowPageVoItem data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id'].toString();
	}
	if (json['customersId'] != null) {
		data.customersId = json['customersId'] is String
				? int.tryParse(json['customersId'])
				: json['customersId'].toInt();
	}
	if (json['customersName'] != null) {
		data.customersName = json['customersName'].toString();
	}
	if (json['stationId'] != null) {
		data.stationId = json['stationId'] is String
				? int.tryParse(json['stationId'])
				: json['stationId'].toInt();
	}
	if (json['stationName'] != null) {
		data.stationName = json['stationName'].toString();
	}
	if (json['stationAddress'] != null) {
		data.stationAddress = json['stationAddress'].toString();
	}
	if (json['tradingTime'] != null) {
		data.tradingTime = json['tradingTime'].toString();
	}
	if (json['tradingSerialNumber'] != null) {
		data.tradingSerialNumber = json['tradingSerialNumber'].toString();
	}
	if (json['oilMachineCode'] != null) {
		data.oilMachineCode = json['oilMachineCode'].toString();
	}
	if (json['greaseGunStationNo'] != null) {
		data.greaseGunStationNo = json['greaseGunStationNo'].toString();
	}
	if (json['gunSerialNumber'] != null) {
		data.gunSerialNumber = json['gunSerialNumber'] is String
				? int.tryParse(json['gunSerialNumber'])
				: json['gunSerialNumber'].toInt();
	}
	if (json['oilName'] != null) {
		data.oilName = json['oilName'].toString();
	}
	if (json['orderQuantity'] != null) {
		data.orderQuantity = json['orderQuantity'] is String
				? double.tryParse(json['orderQuantity'])
				: json['orderQuantity'].toDouble();
	}
	if (json['listedPrice'] != null) {
		data.listedPrice = json['listedPrice'] is String
				? double.tryParse(json['listedPrice'])
				: json['listedPrice'].toDouble();
	}
	if (json['listedAmount'] != null) {
		data.listedAmount = json['listedAmount'] is String
				? double.tryParse(json['listedAmount'])
				: json['listedAmount'].toDouble();
	}
	if (json['pumpYards'] != null) {
		data.pumpYards = json['pumpYards'] is String
				? double.tryParse(json['pumpYards'])
				: json['pumpYards'].toDouble();
	}
	if (json['takeGunTime'] != null) {
		data.takeGunTime = json['takeGunTime'];
	}
	if (json['putGunTime'] != null) {
		data.putGunTime = json['putGunTime'];
	}
	if (json['createTime'] != null) {
		data.createTime = json['createTime'].toString();
	}
	if (json['motorcadeName'] != null) {
		data.motorcadeName = json['motorcadeName'].toString();
	}
	if (json['vehicleNumber'] != null) {
		data.vehicleNumber = json['vehicleNumber'].toString();
	}
	if (json['vehicleImage'] != null) {
		data.vehicleImage = json['vehicleImage'].toString();
	}
	if (json['driverName'] != null) {
		data.driverName = json['driverName'].toString();
	}
	if (json['driverPhone'] != null) {
		data.driverPhone = json['driverPhone'].toString();
	}
	if (json['cardType'] != null) {
		data.cardType = json['cardType'].toString();
	}
	if (json['cardNumber'] != null) {
		data.cardNumber = json['cardNumber'];
	}
	if (json['cardBalance'] != null) {
		data.cardBalance = json['cardBalance'] is String
				? double.tryParse(json['cardBalance'])
				: json['cardBalance'].toDouble();
	}
	if (json['price'] != null) {
		data.price = json['price'] is String
				? double.tryParse(json['price'])
				: json['price'].toDouble();
	}
	if (json['orderAmount'] != null) {
		data.orderAmount = json['orderAmount'] is String
				? double.tryParse(json['orderAmount'])
				: json['orderAmount'].toDouble();
	}
	if (json['paymentMode'] != null) {
		data.paymentMode = json['paymentMode'].toString();
	}
	if (json['paymentModeName'] != null) {
		data.paymentModeName = json['paymentModeName'].toString();
	}
	if (json['discountPattern'] != null) {
		data.discountPattern = json['discountPattern'].toString();
	}
	if (json['discountPatternAmount'] != null) {
		data.discountPatternAmount = json['discountPatternAmount'] is String
				? double.tryParse(json['discountPatternAmount'])
				: json['discountPatternAmount'].toDouble();
	}
	if (json['refuelType'] != null) {
		data.refuelType = json['refuelType'].toString();
	}
	if (json['paymentType'] != null) {
		data.paymentType = json['paymentType'];
	}
	if (json['dataSources'] != null) {
		data.dataSources = json['dataSources'].toString();
	}
	if (json['supplementImgs'] != null) {
		data.supplementImgs = json['supplementImgs'];
	}
	if (json['supplementRemark'] != null) {
		data.supplementRemark = json['supplementRemark'];
	}
	if (json['validStatus'] != null) {
		data.validStatus = json['validStatus'].toString();
	}
	if (json['valid'] != null) {
		data.valid = json['valid'] is String
				? int.tryParse(json['valid'])
				: json['valid'].toInt();
	}
	if (json['vehicleMileage'] != null) {
		data.vehicleMileage = json['vehicleMileage'] is String
				? double.tryParse(json['vehicleMileage'])
				: json['vehicleMileage'].toDouble();
	}
	if (json['vehicleMileageImage'] != null) {
		data.vehicleMileageImage = json['vehicleMileageImage'].toString();
	}
	if (json['operator'] != null) {
		data.operator = json['operator'].toString();
	}
	if (json['classDate'] != null) {
		data.classDate = json['classDate'];
	}
	if (json['shiftName'] != null) {
		data.shiftName = json['shiftName'];
	}
	if (json['rebateCoefficient'] != null) {
		data.rebateCoefficient = json['rebateCoefficient'] is String
				? double.tryParse(json['rebateCoefficient'])
				: json['rebateCoefficient'].toDouble();
	}
	if (json['rebate'] != null) {
		data.rebate = json['rebate'] is String
				? double.tryParse(json['rebate'])
				: json['rebate'].toDouble();
	}
	if (json['oilEnginePrice'] != null) {
		data.oilEnginePrice = json['oilEnginePrice'] is String
				? double.tryParse(json['oilEnginePrice'])
				: json['oilEnginePrice'].toDouble();
	}
	if (json['signatureImage'] != null) {
		data.signatureImage = json['signatureImage'].toString();
	}
	if (json['smallTicketImage'] != null) {
		data.smallTicketImage = json['smallTicketImage'];
	}
	if (json['joinInSmallTicketImage'] != null) {
		data.joinInSmallTicketImage = json['joinInSmallTicketImage'];
	}
	if (json['gunScreenImage'] != null) {
		data.gunScreenImage = json['gunScreenImage'];
	}
	if (json['motorcadeId'] != null) {
		data.motorcadeId = json['motorcadeId'] is String
				? int.tryParse(json['motorcadeId'])
				: json['motorcadeId'].toInt();
	}
	if (json['subCompanyList'] != null) {
		data.subCompanyList = (json['subCompanyList'] as List).map((v) => v.toString()).toList().cast<String>();
	}
	return data;
}

Map<String, dynamic> transactionFlowPageVoItemToJson(TransactionFlowPageVoItem entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['customersId'] = entity.customersId;
	data['customersName'] = entity.customersName;
	data['stationId'] = entity.stationId;
	data['stationName'] = entity.stationName;
	data['stationAddress'] = entity.stationAddress;
	data['tradingTime'] = entity.tradingTime;
	data['tradingSerialNumber'] = entity.tradingSerialNumber;
	data['oilMachineCode'] = entity.oilMachineCode;
	data['greaseGunStationNo'] = entity.greaseGunStationNo;
	data['gunSerialNumber'] = entity.gunSerialNumber;
	data['oilName'] = entity.oilName;
	data['orderQuantity'] = entity.orderQuantity;
	data['listedPrice'] = entity.listedPrice;
	data['listedAmount'] = entity.listedAmount;
	data['pumpYards'] = entity.pumpYards;
	data['takeGunTime'] = entity.takeGunTime;
	data['putGunTime'] = entity.putGunTime;
	data['createTime'] = entity.createTime;
	data['motorcadeName'] = entity.motorcadeName;
	data['vehicleNumber'] = entity.vehicleNumber;
	data['vehicleImage'] = entity.vehicleImage;
	data['driverName'] = entity.driverName;
	data['driverPhone'] = entity.driverPhone;
	data['cardType'] = entity.cardType;
	data['cardNumber'] = entity.cardNumber;
	data['cardBalance'] = entity.cardBalance;
	data['price'] = entity.price;
	data['orderAmount'] = entity.orderAmount;
	data['paymentMode'] = entity.paymentMode;
	data['paymentModeName'] = entity.paymentModeName;
	data['discountPattern'] = entity.discountPattern;
	data['discountPatternAmount'] = entity.discountPatternAmount;
	data['refuelType'] = entity.refuelType;
	data['paymentType'] = entity.paymentType;
	data['dataSources'] = entity.dataSources;
	data['supplementImgs'] = entity.supplementImgs;
	data['supplementRemark'] = entity.supplementRemark;
	data['validStatus'] = entity.validStatus;
	data['valid'] = entity.valid;
	data['vehicleMileage'] = entity.vehicleMileage;
	data['vehicleMileageImage'] = entity.vehicleMileageImage;
	data['operator'] = entity.operator;
	data['classDate'] = entity.classDate;
	data['shiftName'] = entity.shiftName;
	data['rebateCoefficient'] = entity.rebateCoefficient;
	data['rebate'] = entity.rebate;
	data['oilEnginePrice'] = entity.oilEnginePrice;
	data['signatureImage'] = entity.signatureImage;
	data['smallTicketImage'] = entity.smallTicketImage;
	data['joinInSmallTicketImage'] = entity.joinInSmallTicketImage;
	data['gunScreenImage'] = entity.gunScreenImage;
	data['motorcadeId'] = entity.motorcadeId;
	data['subCompanyList'] = entity.subCompanyList;
	return data;
}